package com.xpert.action.board;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xpert.action.CommandAction;
import com.xpert.beans.Board;
import com.xpert.dao.BoardDao;

public class ViewAction implements CommandAction {

  @Override
  public String requestProc(HttpServletRequest request,
  		HttpServletResponse response) throws Throwable {

  	int idx = Integer.parseInt(request.getParameter("idx"));
  	Board article = BoardDao.getInstance().getArticle(idx);
  	String page = request.getParameter("page");

  	request.setAttribute("article", article);
  	request.setAttribute("page", page);

  	return "view.jsp";
	}

}
